<%-- Pagina principal da aplicacao, a listagem de mercadorias. --%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div>
	
	<div>
		<h3>Lista de alunos <small><fmt:formatDate pattern="dd/MM" value="${aula.data}"/></small></h3>
	</div>
	
	<form:form action="salvar-aula" method="POST">
		<input type="hidden" name="aulaId" value="${aula.id}">
		<input type="hidden" name="disciplinaId" value="${aula.disciplinaId}">
		<div class="div-tabela">
			<table class="table small-table">
				<thead>
					<tr>
						<th>Aluno</th>
						<th class="center">Presente </th>
					</tr>
				</thead>
				
				<c:forEach items="${alunosForm}" var="aluno" varStatus="status">
				<tr>
					<td>${aluno.nomeAluno}</td>
					<td class="center">
						<input type="checkbox" name="aluno" value="<c:out value="${aluno.alunoId}"/>"<c:if test="${aluno.presente}">checked</c:if>/>
					</td>
				</tr>
				</c:forEach>
			</table>
		</div>
		<div class="control-group">
	   		<div class="controls">
	   			<button id="salvar" class="btn btn-success">Salvar</button>
	   			<a href="/web/aula?id=${aula.disciplinaId}" class="btn">Cancelar</a>
	   		</div>
	   	</div>
	</form:form>
</div>